<!DOCTYPE html>
<html>
    <head>
        <script src="vue.js"></script>
    </head>
    <body>
        <div id="app">
           <div v-for="(item,key) in list" data-id="key">
               索引是:{{key}},元素内容是:{{item}}
           </div>
        </div>
            <script>
                var vm = new Vue({
                    el: '#app',
                    data: {
                       list: [1,2,3]
                    }
                });
            </script>
        </div>
    </body>
</html>